package com.service;


import com.mapper.textMapper;
import com.mapper.userMapper;
import com.pojo.text;
import com.pojo.user;
import com.util.factory;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

import java.util.List;

public class textService {
    SqlSessionFactory sqlSessionFactory = factory.getSqlSessionFactory();

    //所有数据
    public List<text> textselectAll()
    {
        SqlSession sqlSession = sqlSessionFactory.openSession();
//        获取brandmapper
        textMapper mapper = sqlSession.getMapper(textMapper.class);
//          调用查询的方法
        List<text> texts = mapper.text_selectAll();
        return texts;
    }

    //只查询uID的数据
    public List<text> textselectUser(int uId)
    {
        SqlSession sqlSession = sqlSessionFactory.openSession();
//        获取brandmapper
        textMapper mapper = sqlSession.getMapper(textMapper.class);
//          调用查询的方法
        List<text> texts = mapper.text_selectuser(uId);

        return texts;
    }


}
